package com.qd.common.panda.domain.entity.stroke;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 用户预约单
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
@ToString
public class UserStrokeAppointmentOrderDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "订单ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "订单ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String orderId;
    /**
     * 开始时间
     */
    @NotNull(message = "开始时间不能为空", groups = DefaultGroup.class)
    private LocalDateTime appointmentTime;
    /**
     * 订单金额
     */
    private BigDecimal orderAmount;
    /**
     * 支付状态:0未支付 1支付成功 2支付失败
     */
    @NotNull(message = "支付状态:0未支付 1支付成功 2支付失败不能为空", groups = DefaultGroup.class)
    private Integer payStatus;
    /**
     * 停车场
     */
    @NotBlank(message = "停车场不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "停车场长度不能超过{max}位", groups = DefaultGroup.class)
    private String parkId;
    /**
     * 用户ID
     */
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;
    /**
     * 车牌
     */
    @NotBlank(message = "车牌不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "车牌长度不能超过{max}位", groups = DefaultGroup.class)
    private String plateNumber;
    /**
     * 行程ID
     */
    @NotBlank(message = "行程ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "行程ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String sid;
    /**
     * 行程类型:0停车1充电
     */
    private Integer tripType;
    /**
     * 推广码
     */
    @Size(max = 20, message = "推广码长度不能超过{max}位", groups = DefaultGroup.class)
    private String promotionCode;

    @Override
    public void freeData() {
        this.orderId = null;
        this.appointmentTime = null;
        this.orderAmount = null;
        this.payStatus = null;
        this.parkId = null;
        this.userId = null;
        this.plateNumber = null;
        this.sid = null;
        this.tripType = null;
        this.promotionCode = null;
        super.freeData();
    }
}
